import fetch from 'utils/fetch';
/* 结算管理*/
//查看结算列表

export function listSettlementAgentData(provinceId, cityId, areaId, applicationStartDate, applicationEndDate, status, headName, bankCardNumber, bankAccountName, page, rows) {
    const data = {
        provinceId,
        cityId,
        areaId,
        applicationStartDate,
        applicationEndDate,
        status,
        headName,
        bankCardNumber,
        bankAccountName,
        page,
        rows
    };
    return fetch({
        url: '/settlementAgent/listSettlementAgentData',
        method: 'post',
        data
    })
}

//昨日结算
export function getYesterdaySettlement() {
    const data = {

    };
    return fetch({
        url: '/settlementAgent/getYesterdaySettlement',
        method: 'post',
        data
    });
}

//查询区域代理
// export function listAgentProvinces(userId) {
//     const data = {
//         userId
//     };
//     return fetch({
//         url: '/settlementAgent/listAgentProvinces',
//         method: 'post',
//         data
//     });
// }

export function listAgentProvinces(userId) {
    const data = {

    };
    return fetch({
        url: '/settlementAgent/listAgentProvinces/' + userId,
        method: 'post',
        data
    });
}

//导出

export function exportSettlementAgentData(provinceId, cityId, areaId, applicationStartDate, applicationEndDate, status, headName, bankCardNumber, bankAccountName, AccessToken) {
    const params = {
        provinceId,
        cityId,
        areaId,
        applicationStartDate,
        applicationEndDate,
        status,
        headName,
        bankCardNumber,
        bankAccountName,
        AccessToken
    };
    return fetch({
        url: '/settlementAgent/exportSettlementAgentData',
        method: 'get',
        params
    });
}




//操作
export function updateSettlementInfo(cashId, pId, orgAccountId, status, reason) {
    const data = {
        cashId,
        pId,
        orgAccountId,
        status,
        reason
    };
    return fetch({
        url: '/settlementAgent/updateSettlementInfo',
        method: 'post',
        data
    });
}





//累计结算
export function getAccumulatedSum() {
    const data = {

    };
    return fetch({
        url: '/settlementAgent/getAccumulatedSum',
        method: 'post',
        data
    });
}

//批量完成
export function updateBatchSettlementInfo(batchPId) {
    const data = {
        batchPId
    };
    return fetch({
        url: '/settlementAgent/updateBatchSettlementInfo',
        method: 'post',
        data
    });
}